﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminGroupManager.ascx.cs" Inherits="CMS.Controls.AdminGroup.AdminGroupManager" %>
<%@ Import Namespace="Core.AdminGroup" %>
<%@ Import Namespace="Core.Library" %>

<asp:PlaceHolder ID="plcControl" runat="server"/>
<!-- / placeholder -->
    
<asp:Literal ID="ltMessage" runat="server"/>
<!-- / message -->

<div class="widget first">        
    <div class="head"><h5 class="iFrames">Danh sách nhóm</h5></div>
    <div class="dataTables_wrapper">
        <div class="dataTables_filter" style="top: -39px;">
            <label>
                <a href="<%= UrlHelpers.CreateGroup %>" class="btn14 topDir" title="Tạo nhóm mới">
                    <img src="/images/icons/dark/add.png" alt=""/>
                </a>
            </label>
        </div>
    </div>

    <asp:ListView ID="lvGroup" DataKeyNames="AdminGroupId" runat="server" OnItemDataBound="lvGroup_ItemDataBound" OnItemCommand="lvGroup_ItemCommand">
    <LayoutTemplate>        
    <table width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
        <thead>
            <tr>
                <td>STT</td>
                <td>Tên nhóm</td>
                <td>Mô tả</td>
                <td>Độ ưu tiên</td>                    
                <td class="w60">Chức năng</td>                                        
                <td class="w100">Thao tác</td>
            </tr>
        </thead>
        <tbody>
            <tr id="itemPlaceHolder" runat="server"></tr>
        </tbody>
    </table>
    </LayoutTemplate>
    <ItemTemplate>
    <tr>
        <td class="aligncenter">
            <%# Container.DataItemIndex + 1 %>
            <asp:HiddenField ID="hfAdminGroupId" Value='<%# ((AdminGroupObject)Container.DataItem).AdminGroupId %>' runat="server"/>
            <asp:HiddenField ID="hfStatus" Value='<%# ((AdminGroupObject)Container.DataItem).Status %>' runat="server"/>
        </td>
        <td><%# ((AdminGroupObject)Container.DataItem).Name %></td>
        <td><%# ((AdminGroupObject)Container.DataItem).Description %></td>
        <td class="aligncenter"><%# ((AdminGroupObject)Container.DataItem).Priority %></td>            
        <td class="aligncenter">
            <a href="<%# UrlHelpers.AdminGroupMenu(ConvertUtility.ConvertTo<int>(((AdminGroupObject)Container.DataItem).AdminGroupId)) %>" class="btn14 topDir" title="Phân quyền chức năng cho nhóm">
                <img src="/images/icons/dark/cog3.png" alt=""/>
            </a>
        </td>            
        <td class="aligncenter">           
            <asp:HyperLink runat="server" ID="hlEdit" CssClass="ml5 btn14 topDir" ToolTip="Sửa" CommandName="EditGroup">
                <img src="/images/icons/dark/pencil.png" alt=""/>
            </asp:HyperLink>
            <asp:LinkButton runat="server" ID="lnkDelete" CssClass="ml5 btn14 topDir" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');" CommandName="DeleteGroup">
                <img alt="Xóa" src="/images/icons/dark/close.png"/>
            </asp:LinkButton>                                  
        </td>
    </tr>                	
    </ItemTemplate>
    </asp:ListView>

</div>
<!-- / list group -->
